package org.lqq.service;

import org.lqq.dao.TestDao;
import org.lqq.entity.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 李清泉 on 2017/12/15.
 *
 * @remark
 */
@Service
public class StudentService {
    @Autowired
    private TestDao testDao;

    public int likeName(String name){
        if("1".equals(name)){
            return 1;
        }else if("2".equals(name)){
            return 2;
        }else {
            return 3;
        }
    }

    public void testinsert(Test test){

        testDao.insert(test);
    }


    public List<Test> query(Test query){
        int count=testDao.count(query);
        query.setPageCount(count);
        return testDao.query(query);
    }

}
